import { useState,useEffect } from "react";

function App() {

  const [count,setCount] = useState(0);

  useEffect(()=>{
    console.log('组件渲染完成');
    return ()=>{
      console.log('组件即将销毁');
    }
  },[count]) //为count 添加副作用用函数
  console.log('渲染中');
  

  return(
    <div className="app">
      <button onClick={()=>setCount(count+1)}>100</button>
    </div>
  )
}
export default App;